<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:c="http://java.sun.com/jstl/core"
      xmlns:fn="http://java.sun.com/jsp/jstl/functions"
      xmlns:rich="http://richfaces.org/rich"
      xmlns:a4j="http://richfaces.org/a4j"
      xmlns:t="http://myfaces.apache.org/tomahawk">
<ui:composition>
	<c:if test="${empty paginacao}">
		<c:set var="paginacao" value="${true}" />
	</c:if>
	<c:if test="${empty id}">
		<c:set var="id" value="${'tabela'}" />
	</c:if>
	<c:if test="${empty listaTabela}">
		<c:set var="listaTabela" value="${'lista'}" />
	</c:if>
	<c:if test="${empty binding}">
		<c:set var="binding" value="${'tabela'}" />
	</c:if>
	<c:if test="${empty linhas}">
		<c:set var="linhas" value="${25}" />
	</c:if>
	<f:loadBundle basename="mensagens" var="msg" />
	<h:form>
		<h:panelGroup id="${id}">
			<a4j:loadStyle src="resource:///cssjs/template.css" />
			<a4j:loadScript src="resource:///cssjs/template.js" />
			<h:outputFormat value="#{msg.fr_nao_foram_encontrados_registros}" styleClass="textSemRegistros" rendered="#{empty backingBean[listaTabela]}"/>
			<c:if test="${empty limiteRegistros}">
				<h:outputFormat value="#{msg.fr_quantidade_registros}" styleClass="textSemRegistros" rendered="#{!(empty backingBean[listaTabela])}">
					<f:param value="#{backingBean[listaTabela].size()}"/>
				</h:outputFormat>
			</c:if>
			<c:if test="${!(empty limiteRegistros)}">
				<h:outputFormat value="#{msg.fr_quantidade_registros}" styleClass="textSemRegistros" rendered="#{!(empty backingBean[listaTabela]) and backingBean[listaTabela].size() lt limiteRegistros}">
					<f:param value="#{backingBean[listaTabela].size()}"/>
				</h:outputFormat>
				<h:outputFormat value="#{msg.fr_quantidade_registros_limitados}" styleClass="textSemRegistros" style="color: darkred;" rendered="#{backingBean[listaTabela].size() == limiteRegistros}">
					<f:param value="#{backingBean[listaTabela].size()}"/>
				</h:outputFormat>
			</c:if>
			<rich:dataTable id="${id}DataTable" stateVar="varEstado" rowKeyVar="varLinha" value="${backingBean[listaTabela]}" binding="${backingBean[binding]}" rows="${linhas}" var="aux" width="100%" rowClasses="rowOdd,rowEven" rendered="${backingBean[listaTabela] != null and backingBean[listaTabela].size() > 0}">
				<ui:insert/>
				<c:if test="${paginacao}" >
					<f:facet name="footer">
						<rich:datascroller id="${id}dsfooter"/>
					</f:facet>
				</c:if>
			</rich:dataTable>
		</h:panelGroup>
		<rich:jQuery selector="##{id}DataTable tbody tr" query="live('mouseover', function(){jQuery(this).addClass('rowOver')})"/> 
		<rich:jQuery selector="##{id}DataTable tbody tr" query="live('mouseout', function(){jQuery(this).removeClass('rowOver')})"/>
	</h:form>
</ui:composition>
</html>